/*
 * Copyright 2012 Sedov Eduard.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.es.registry;

/**
 * The interface to monitor changes of a node.
 *
 * @author Sedov Eduard
 */
public interface NodeListener {

    /**
     * Called whenever the name of the node changed.
     *
     * @param node the node, whose name is changed
     * @param oldName the old name
     * @param newName the new name
     */
    public void onName(Node node, String oldName, String newName);

    /**
     * Called whenever the parent of the node changed.
     *
     * @param node the node, whose parent is changed
     * @param oldParent the old parent
     * @param newParent the new parent
     */
    public void onParent(Node node, Node oldParent, Node newParent);

    /**
     * Called whenever a value is set or changed.
     *
     * @param node the node, whose value is set or changed
     * @param name the name of value
     * @param oldValue the old value
     * @param newValue the new value
     */
    public void onSet(Node node, String name, Object oldValue, Object newValue);

    /**
     * Called whenever a value is removed.
     *
     * @param node the node, whose value is removed
     * @param name the name of value
     * @param value the value
     */
    public void onRemove(Node node, String name, Object value);
}
